$(function () {
    var listView = $('#listView');

   $(function () {
      $.ajax({
          url:baseUrl+'mobile/shortcut/getCar',
          dataType:'json',
          method:'post',
          data:{showStatus:1},
          success:function (data) {
              var str ='';
              $.each(data,function (i,item) {
                  var left ='';
                  if(item.tStartTime != null){
                      if(item.tRealStart !=null){
                          left = '<div class="m-right"><span class="m-badge c1">'+item.tRealStart+'</span></div>';
                      }else {
                          left = '<div class="m-right"><span class="m-badge c2">'+item.tStartTime+'</span></div>';
                      }
                  }
                  str += '<li><a  nodeId="'+item.iCarId+'" href="javascript:void(0)" onclick="openit(this)"><div class="content" style="width: 210px;">'+item.sPlateNum+'</div>'+left+'</a></li>';
              });
              if(data.length > 0){
                  listView.append(str);
              }
          }
      })

   });

    window.top.bindBack(function () { //返回
        window.top.goHome();
    });

});
function openit(target){ //跳转页面
    window.top.registerBack();//注册返回
    var id   = $(target).attr('nodeId');
    var carPlate = $(target).find('.content').text().split('(')[0];
    $('#targetFrame',window.parent.document).attr('src',baseUrl+'mobile/shortcut/useCarHistory?iCarId='+id);
    window.parent.setTitle(carPlate);
    window.parent.goTarget();
}





